﻿#include "datainfo.h"
#include "ui_datainfo.h"

DataInfo::DataInfo(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::DataInfo)
{
    ui->setupUi(this);
    setWindowTitle("信息录入系统");
}

DataInfo::~DataInfo()
{
    delete ui;
}

void DataInfo::showTable()
{
    model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    model->select();
    ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    ui->tableView->setModel(model);
    ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
}

void DataInfo::on_pushButton_clicked()
{
    this->parentWidget()->show();
    delete this;
}
